unit Principal;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.Menus, Vcl.ExtCtrls,
  Vcl.Imaging.jpeg;

type
  TformPrincipal = class(TForm)
    menuPrincipal: TMainMenu;
    imCadastros: TMenuItem;
    imDiversos: TMenuItem;
    imGerenciadorLogins: TMenuItem;
    imConvenios: TMenuItem;
    imProcedimentos: TMenuItem;
    imAgenda: TMenuItem;
    imAgendaConsulta: TMenuItem;
    imConvenio: TMenuItem;
    imTabelaPrecos: TMenuItem;
    N1: TMenuItem;
    imVersoes: TMenuItem;
    imProcedimento: TMenuItem;
    imCliente: TMenuItem;
    N2: TMenuItem;
    imFornecedores: TMenuItem;
    imCidades: TMenuItem;
    Image1: TImage;
    imAnamnese: TMenuItem;
    imOdontograma: TMenuItem;
    procedure FormCreate(Sender: TObject);
    procedure imGerenciadorLoginsClick(Sender: TObject);
    procedure imAgendaConsultaClick(Sender: TObject);
    procedure imConvenioClick(Sender: TObject);
    procedure imTabelaPrecosClick(Sender: TObject);
    procedure imProcedimentoClick(Sender: TObject);
    procedure imVersoesClick(Sender: TObject);
    procedure imClienteClick(Sender: TObject);
    procedure imCidadesClick(Sender: TObject);
    procedure imFornecedoresClick(Sender: TObject);
    procedure imAnamneseClick(Sender: TObject);
  private
  public
  end;

var
  formPrincipal: TformPrincipal;

implementation

{$R *.dfm}

uses odontoLogin, odontoCadLogins, Funcoes, odontoCadConvenio, 
  odontoCadCliente, OdontoCadProcedimento, OdontoAgenda, OdontoCadTabelaPreco, OdontoCadVerProc,
  OdontoCadCidades, OdontoCadFornecedor, OdontoCadAnamnese;

procedure TformPrincipal.imClienteClick(Sender: TObject);
begin
   formOdontoCadCliente := ( abreJanela( TformOdontoCadCliente, Self ) as TformOdontoCadCliente );
end;

procedure TformPrincipal.imAnamneseClick(Sender: TObject);
begin
   formCadAnamnese := ( abreJanela( TformCadAnamnese, Self ) as TformCadAnamnese );
end;

procedure TformPrincipal.imCidadesClick(Sender: TObject);
begin
   formCadCidades := ( abreJanela( TformCadCidades, Self ) as TformCadCidades );
end;

procedure TformPrincipal.FormCreate(Sender: TObject);
begin

   formLogin := TformLogin.Create(Application);
   formLogin.ShowModal;

   if ( formLogin.edLogin.Text <> 'SA' ) then
      validaAcesso(menuPrincipal);

   Self.Repaint;

end;

procedure TformPrincipal.imFornecedoresClick(Sender: TObject);
begin
   formCadFornecedor := ( abreJanela( TformCadFornecedor, Self ) as TformCadFornecedor );
end;

procedure TformPrincipal.imConvenioClick(Sender: TObject);
begin
   formCadConvenio := ( abreJanela( TformCadConvenio, Self ) as TformCadConvenio );
end;

procedure TformPrincipal.imGerenciadorLoginsClick(Sender: TObject);
begin
   formCadLogin := ( abreJanela( TformCadLogin, Self ) as TformCadLogin );
end;

procedure TformPrincipal.imTabelaPrecosClick(Sender: TObject);
begin
   formTabelaPreco := ( abreJanela( TformTabelaPreco, Self ) as TformTabelaPreco );
end;

procedure TformPrincipal.imProcedimentoClick(Sender: TObject);
begin
   formOdontoCadProcedimento := ( abreJanela( TformOdontoCadProcedimento, Self ) as TformOdontoCadProcedimento );
end;

procedure TformPrincipal.imVersoesClick(Sender: TObject);
begin
   formCadVersaoProcedimento := ( abreJanela( TformCadVersaoProcedimento, Self ) as TformCadVersaoProcedimento );
end;

procedure TformPrincipal.imAgendaConsultaClick(Sender: TObject);
begin
   formAgenda := ( abreJanela( TformAgenda, Self ) as TformAgenda );
end;

end.
